#ifndef __RADARDECT_H__
#define __RADARDECT_H__

#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum _LOG_OUTPOS {
  LOG_OUTPOS_NONE = 0,
  LOG_OUTPOS_CONSOLE,
  LOG_OUTPOS_FILE,
  LOG_OUTPOS_ALL,
} LOG_OUTPOS_e;

typedef struct SocTrigInfo {
  uint32_t trig_type;
  uint8_t park_state;
  uint16_t empty_threshold;
  uint16_t is_car_change;
  uint16_t radar_data;
} SocTrigInfo_t;

typedef int (*SOCTrigCb)(int soc_state, void *param);
typedef int (*RadarTrigCb)(uint16_t *dist, uint16_t *amp, void* param);

int RadarDet_Init(const char* file_name, LOG_OUTPOS_e log_pos);
int RadarDet_Uninit();
int RadarDet_Exec();
int RadarDet_SetSOCTrigCallBack(SOCTrigCb cb, void* param);
int RadarDet_SetRadarTrigCallBack(RadarTrigCb cb, void* param);
int RadarDet_SetAlgResult(uint8_t park_state, uint8_t has_plate);
int RadarDet_ShutSocPower();
int RadarDet_GetTrigInfo(SocTrigInfo_t* info);
int RadarDet_SetExecInterval(uint64_t interval_in_ms);
#ifdef __cplusplus
}
#endif

#endif

